package com.xiaoq.shop.entity;

import com.xiaoq.MongoEntity;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import org.hibernate.validator.constraints.NotEmpty;
import org.mongodb.morphia.annotations.Entity;

import javax.validation.constraints.NotNull;

/**
 * @author qudongxin520 created at 2016/7/28.
 * @author xinpeng
 */

@Entity(value = "coupon_collection" ,noClassnameStored = true)
public class CouponEntity extends MongoEntity {

    private String shopId;

    private String shopName; //小店名称

    @ApiModelProperty(value = "优惠券模板编码",dataType = "java.lang.String",required = true)
    private Long couponTemplateCode;  //一种面额,一个模板编码

    @NotEmpty(message = "coupon title is null")
    @ApiModelProperty(value = "优惠券标题",dataType = "java.lang.String",required = true)
    private String title;

    @ApiModelProperty(value = "优惠券面额",dataType = "java.lang.Integer",required = true)
    private Integer denomination ;

    @ApiModelProperty(value = "优惠券使用最低消费金额",dataType = "java.lang.Integer",required = true)
    private Integer minSpendingAmountForUse;

    @ApiModelProperty(value = "无使用条件(无1 有0)",dataType = "java.lang.Integer",required = true)
    private Integer unconditional; // 无1 有0

    @ApiModelProperty(value = "优惠券生效日期",dataType = "java.lang.Long",required = true)
    private Long effectiveDate;

    @ApiModelProperty(value = "优惠券失效日期",dataType = "java.lang.Long",required = true)
    private Long expirationDate;

    @NotNull(message = "coupon count is null")
    @ApiModelProperty(value = "优惠券数量",dataType = "java.lang.Integer",required = true)
    private Integer count;

    @NotNull(message = "coupon limitCount is null")
    @ApiModelProperty(value = "优惠券限制领取个数",dataType = "java.lang.Integer",required = true)
    private Integer limitCount;

    @NotEmpty(message = "coupon extension is null")
    @ApiModelProperty(value = "推广方式(1买家领取，2卖家发放)",dataType = "java.lang.String",required = true)
    private String extension;  //1买家领取，2卖家发放

    @NotEmpty(message = "coupon description is null")
    @ApiModelProperty(value = "描述",dataType = "java.lang.String",required = true)
    private String description;

    /**
     * 判断优惠券是否有效根据 effectiveDate 和 expirationDate
     * state是一个状态，判断是否在APP 段显示
     */
    @ApiModelProperty(value = "状态(0：C端不显示)",dataType = "java.lang.Integer",required = false,hidden = true)
    private Integer state;  //状态,0,不显示,1,显示

    @ApiModelProperty(value = "状态(1删除 0 正常；)",dataType = "java.lang.Integer",required = false,hidden = true)
    private Integer delete = 0; //1删除 0 正常；

    @ApiModelProperty(value = "是否提醒(1提醒 0不提醒)",dataType = "java.lang.Integer",required = false,hidden = true)
    private Integer notify = 0; //1提醒 0不提醒；

    public Integer takenCount;  //已被领取的数量

	public String getShopId() {
		return shopId;
	}

	public void setShopId(String shopId) {
		this.shopId = shopId;
	}

	public String getShopName() {
		return shopName;
	}

	public void setShopName(String shopName) {
		this.shopName = shopName;
	}

	public Long getCouponTemplateCode() {
		return couponTemplateCode;
	}

	public void setCouponTemplateCode(Long couponTemplateCode) {
		this.couponTemplateCode = couponTemplateCode;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Integer getDenomination() {
		return denomination;
	}

	public void setDenomination(Integer denomination) {
		this.denomination = denomination;
	}

	public Integer getMinSpendingAmountForUse() {
		return minSpendingAmountForUse;
	}

	public void setMinSpendingAmountForUse(Integer minSpendingAmountForUse) {
		this.minSpendingAmountForUse = minSpendingAmountForUse;
	}

	public Integer getUnconditional() {
		return unconditional;
	}

	public void setUnconditional(Integer unconditional) {
		this.unconditional = unconditional;
	}

	public Long getEffectiveDate() {
		return effectiveDate;
	}

	public void setEffectiveDate(Long effectiveDate) {
		this.effectiveDate = effectiveDate;
	}

	public Long getExpirationDate() {
		return expirationDate;
	}

	public void setExpirationDate(Long expirationDate) {
		this.expirationDate = expirationDate;
	}

	public Integer getCount() {
		return count;
	}

	public void setCount(Integer count) {
		this.count = count;
	}

	public Integer getLimitCount() {
		return limitCount;
	}

	public void setLimitCount(Integer limitCount) {
		this.limitCount = limitCount;
	}

	public String getExtension() {
		return extension;
	}

	public void setExtension(String extension) {
		this.extension = extension;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Integer getState() {
		return state;
	}

	public void setState(Integer state) {
		this.state = state;
	}

	public Integer getDelete() {
		return delete;
	}

	public void setDelete(Integer delete) {
		this.delete = delete;
	}

	public Integer getNotify() {
		return notify;
	}

	public void setNotify(Integer notify) {
		this.notify = notify;
	}

	public Integer getTakenCount() {
		return takenCount;
	}

	public void setTakenCount(Integer takenCount) {
		this.takenCount = takenCount;
	}
    
    

}
